<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8" />
        <title>HTML Preview(markdown to html) - Editor.md examples</title>
        <link rel="stylesheet" href="css/style.css" />
        <link rel="stylesheet" href="../dist/css/editormd.preview.css" />
        <style>
            .editormd-html-preview {
                width: 90%;
                margin: 0 auto;
            }
        </style>
    </head>
    <body>
        <div id="layout">
            <header>
                <h1>非编辑情况下的HTML预览</h1>           
            </header>
            <div id="test-editormd-view">
               <textarea style="display:none;">###Hello world!</textarea>               
            </div>
        </div>
        
        <!-- <script src="js/zepto.min.js"></script>
		<script>		
			var jQuery = Zepto;  // 为了避免修改flowChart.js和sequence-diagram.js的源码，所以想支持flowChart/sequenceDiagram就得加上这一句
		</script> -->
        <script src="js/jquery.min.js"></script>
        <script src="../lib/marked.min.js"></script>
        <script src="../lib/prettify.min.js"></script>
        
        <script src="../lib/raphael.min.js"></script>
        <script src="../lib/underscore.min.js"></script>
        <script src="../lib/sequence-diagram.min.js"></script>
        <script src="../lib/flowchart.min.js"></script>
        <script src="../lib/jquery.flowchart.min.js"></script>

        <script src="../src/js/editormd.js"></script>  
        <script type="text/javascript">
			var testEditormdView;

            $(function() {
                $.get("test.md", function(markdown) {
				    testEditormdView = editormd.markdownToHTML("test-editormd-view", {
                        markdown : markdown,     // 不设置时，从<script type="text/markdown">获取markdown文档
                        htmlDecode : true,       // 开启HTML标签解析，为了安全性，默认不开启
                        tex : true,              // 默认不解析
                        flowChart: true,         // 默认不解析
                        sequenceDiagram : true,  // 默认不解析
                    });
                    
                    console.log("返回一个jQuery实例 =>", testEditormdView);
                    
                    // 获取Markdown源码
                    console.log(testEditormdView.getMarkdown());
                });
            });
        </script>
    </body>
</html>